#ifndef __tcpping_h__
#define __tcpping_h__ 1
enum{
    TCPPING_SUCCESS = 0,
    TCPPING_ERR_CREAT_SOCK,
    TCPPING_ERR_SELECT,
    TCPPING_ERR_IP_NONE,
    TCPPING_ERR_NOT_REACH,
    TCPPING_ERR_CONNECT,
};
typedef struct{
    uint32_t ip;
    uint16_t port;
    int counts;
    int timeout;// ms
}tcpping_arg_t;

typedef struct{
    float latency;
    float max_latency, min_latency;
    int snd_count;
    int rcv_count;
    float lost_percent, jitter;
}tcpping_result_t;

void* do_tcpping(void* _arg);
void tcpping_result_print(tcpping_result_t *result);

#endif